package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.entity.AbdulBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;

/**
 * 会员储值卡信息实体类
 */
@Data
@ApiModel("会员储值卡信息")
@TableName("member_stored_value_card")
public class MemberStoredValueCard extends AbdulBaseEntity {

    @ApiModelProperty(value = "主键ID", example = "1")
    private Long id;

    @ApiModelProperty("卡类型, 储值卡类型 1-充值卡 2-定额卡")
    private Integer cardType;

    @ApiModelProperty(value = "会员ID(关联会员表)", example = "1001")
    private Long memberId;

    @ApiModelProperty(value = "会员手机号", example = "13800000000")
    private String memberPhone;

    @ApiModelProperty(value = "账户余额(元)", example = "100.00")
    private BigDecimal balance;

    @ApiModelProperty(value = "赠送余额(元)", example = "50.00")
    private BigDecimal giftBalance;

    @ApiModelProperty(value = "有效期开始", example = "2025-01-01")
    private LocalDate expiryStart;

    @ApiModelProperty(value = "有效期结束")
    private LocalDate expiryEnd;

    @ApiModelProperty(value = "状态（1-正常/2-停用）", allowableValues = "1,2", example = "1")
    private Integer status;

    @ApiModelProperty(value = "办卡门店", example = "旗舰店")
    private String storeName;

    @ApiModelProperty(value = "操作员工", example = "张三")
    private String operator;

    @ApiModelProperty(value = "卡号", example = "CARD20230001")
    private String cardNumber;

    @ApiModelProperty(value = "卡名称", example = "黄金储值卡")
    private String cardName;

    @ApiModelProperty(value = "卡编号  关联stored_value_card_management表id")
    private Long cardManagementId;

    @ApiModelProperty("支付金额")
    private BigDecimal payAmount;

    @ApiModelProperty("获得积分")
    private Integer getIntegral;

    @ApiModelProperty("支付方式")
    private String payType;

    @ApiModelProperty("退款充值金额")
    private BigDecimal refundAmount;

    @ApiModelProperty("退款充值赠送金额")
    private BigDecimal refundGiveAmount;

    @ApiModelProperty("退款支付方式")
    private String refundPayType;

    @ApiModelProperty("退款时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date refundTime;

    @ApiModelProperty("卡别称")
    private String cardAlias;
    //DTO
    @ApiModelProperty("办卡开始时间")
    @TableField(exist = false)
    private Date beginTime;
    @ApiModelProperty("办卡结束时间")
    @TableField(exist = false)
    private Date endTime;

    @ApiModelProperty("到期开始时间")
    @TableField(exist = false)
    private Date expireBeginTime;
    @ApiModelProperty("到期结束时间")
    @TableField(exist = false)
    private Date expireEndTime;
}
